const path = require("path");
const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  configureWebpack: {
    resolve: {
      // 设置路径别名
      alias: {
        "@": path.resolve("src"),
        "@public": path.resolve("public"),
        "@img": path.resolve("src/assets/images"),
        "@js": path.resolve("src/assets/js"),
        "@css": path.resolve("src/assets/styles"),
        "@views": path.resolve("src/views"),
      },
    },
  },
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          javascriptEnabled: true,
        },
      },
    },
  },
  // 开发服务器配置
  devServer: {
    // 端口号
    port: 8080,
    // 启用 https
    https: false,
    // 自动打开浏览器
    open: true,
    // 代理配置
    proxy: {
      "/md-api": {
        // target: "http://124.223.52.115:5810",
        target: "http://192.168.1.4:5810",
        ws: true,
        changeOrigin: true,
      },
    },
  },
});
